﻿using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Qiniu.JSON;

namespace YunSpace.Core
{
    public class AnotherJsonSerializer : IJsonSerializer
    {
        // 实现此接口的JSON序列化方法
        public string Serialize<T>(T obj) where T : new()
        {
            var settings = new JsonSerializerSettings();
            settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            settings.NullValueHandling = NullValueHandling.Ignore;
            return JsonConvert.SerializeObject(obj, settings);
        }
    }
}
